package com.lqq.controller.restfull;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author lqq
 * @date 2019/1/6
 */
@RestController
@Api(description = "index")
public class IndexController {


    //@RequestMapping({"", "/" , "/index"})
    //@ApiOperation(value = "index",httpMethod = "GET")
    //public String index() throws UnknownHostException {
    //    InetAddress address = InetAddress.getLocalHost();
    //    return  "indexMethod: 当前主机ip地址信息：" + address.getHostAddress();
    //}
    //
    //@RequestMapping({"/hello"})
    //@ApiOperation(value = "hello",httpMethod = "GET")
    //public String getIP() throws UnknownHostException {
    //    InetAddress address = InetAddress.getLocalHost();
    //    //System.out.println(address.getHostName());//主机名
    //    //System.out.println(address.getCanonicalHostName());//主机别名
    //    //System.out.println(address.getHostAddress());//获取IP地址
    //    return  "helloMethod: 当前主机ip地址信息：" + address.getHostAddress();
    //}
}
